package org.TCPcase2;

import java.io.*;
import java.net.Socket;

public class Client {
    public static void main(String[] args) throws IOException {
        Socket socket=new Socket("127.0.0.1",10086);
        BufferedWriter bufferedWriter=new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
        BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(socket.getInputStream()));
        String Cdata="客户端数据";
        bufferedWriter.write(Cdata+"\n");
        bufferedWriter.flush();
        socket.shutdownOutput();
        String s = bufferedReader.readLine();
        System.out.println(s);
        socket.close();
    }
}
